
import yaml

#读取
def read_yaml(key):
    with open("extract.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value[key]
#写入
def write_yaml(data):
    with open("extract.yaml",encoding="utf-8",mode="a+")as f:
        yaml.safe_dump(data,f,allow_unicode=True)


#清空
def clean_yaml():
    with open("extract.yaml",encoding="utf-8",mode="w")as f:
        pass


#读取测试用例
def read_testcase(yaml_path):
    with open("test_login.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value

def read_testcasecreatAC(yaml_path):
    with open("test_creatActivity.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value

def read_testcaseAcList(yaml_path):
    with open("test_activityList.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value


def read_testcasePrList(yaml_path):
    with open("test_prizeList.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value

def read_testcasePrCre(yaml_path):
    with open("test_creatPrize.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value

def read_testUserList(yaml_path):
    with open("test_userList.yaml",encoding="utf-8")as f:
        value = yaml.safe_load(f)
        return value